﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="EditProductAttribute.aspx.cs" Inherits="Admin_addProductAttribute" %>
<%@ Register Src="adminfoot.ascx" TagName="adminfoot" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head >
    <title>无标题页</title>
    <link rel="stylesheet" href="imgs/admin.css" type="text/css" media="all" />
    <script type="text/javascript" src="../DotNet_net/js/jquery-1.3.2.min.js"></script>
    <script type="text/javascript" src="../DotNet_net/js/jquery.form.js"></script>
    <script type="text/javascript" src="../DotNet_net/js/common.js"></script>
    <script type="text/javascript" src="imgs/GetAjax.js"></script>
</head>
<body onload='$("#loading").hide()'>
<div class="container" id="cpcontainer">
<div id="loading" style="display:block">   
    <div class="loading-indicator">   
        页面正在加载中...   
    </div>   
</div>   
<table class="tb">
<tr class="thead"><th colspan="2">
    编辑产品属性(<font color='red'>＊</font>为必填,其它选填)<span style="color: #ff0000"></span></th></tr>
	<tr>
	  <td align="center" height="22" style="width: 199px">
          产品名称：</td>
	  <td><input readonly="readonly" id="productName_txt" name="productName_txt" size="23" autocomplete="off"  value="" runat="server"  />&nbsp;<font color='red'>＊</font>属性类型：<%=attributeDp("attributeDp")%>&nbsp;          
      </td>
	</tr>
	<tr>
	  <td align="center" height="22" style="width: 199px">
          产品属性信息：</td>
	   <td>
	       <asp:Repeater ID="Repeater1" runat="server">
	       <HeaderTemplate>
	        <table class="tb">
	                <tr>
	                <td>ID</td>
	                <td>属性名称</td>
	                <td>属性类别</td>
	                <td>属性链接</td>
	                <td>操作</td>	                
	                </tr>
	       </HeaderTemplate>
	            <ItemTemplate>	               
	                <tr>
	                <td><%#Eval("ProductAttributeID") %></td>
	                <td><%#Eval("ProductAttributeValue") %></td>
	                <td><%#getAttributeName(Eval("AttributeID")) %></td>
	                <td><%#Eval("ProductAttributeUrl") %></td>
	                <td>
	                <input id="Button6" type="button" value="编辑" class="btn" title="<%#Eval("ProductAttributeID") %>" onclick="edit(this.title)"/>
	                <input id="btnDel" type="button" value="删除" class='btn' title='<%#Eval("ProductAttributeID") %>' onclick="del(this.title);"/></td>	               
	                </tr>	                
	            </ItemTemplate>
	            <FooterTemplate>
	            </table>
	            </FooterTemplate>
           </asp:Repeater>
       </td>
	</tr>
    <tr class="thead">
        <td align="center" height="22" style="width: 199px">
            修改产品属性：</td>
        <td></td>
    </tr>
    <tr>
        <td align="center" height="22" style="width: 199px">
            产品属性名称：</td>
        <td>
        <input id="productAttributeVlaue_txt" name="productAttributeVlaue_txt" size="23" autocomplete="off"  value="" runat="server"  /></td>
    </tr>
<tr>    
	<td height="22" align="center" style="width: 199px">产品属性相关链接：</td>
	<td>&nbsp;<iframe src="FileDownLoad/ZrNet_upload.htm" scrolling="no" topmargin="0" width="300" height="24" marginwidth="0" marginheight="0" frameborder="0"></iframe><span style="color: #ff0000">支持文件类型gif|jpg|bmp|png|pdf，大小5M以下          <input id="content" type="hidden" value=""  name="content" runat="server"/></span></td>       
</tr>
	 <tr>
   <td style="height: 27px; width: 199px;"></td> <td class="forumRow" style="height: 27px" ><input type="button" class="btn" value="确认保存" name="button" id="tijiao" onclick="save()" runat="server"  />&nbsp;<input type="reset" class="btn" value="清 除"  onclick="resetCon('FCKeditor1')">&nbsp;<input type=button class="btn" value="返　回" onClick="javascript:location.href='adminProduct.aspx';"/>
       <input id="Hidden1" runat="server" type="hidden" />
       <input id="Hidden2" type="hidden" runat="server" /></td>
  </tr>
</table>
<uc1:adminfoot ID="Adminfoot1" runat="server" /> 
</div>
<script type="text/javascript">
    function change()
    {  
      $("#loading").show();
      url=convertURL("EditProductAttribute.aspx?action=change&attributeID="+$("#attributeDp :selected").attr("value")+"&pid="+$("#Hidden1").attr("value"));
      ajax_get(url,'',function(msg)
      {
        $("#cpcontainer").empty().append(msg);   
        $("#loading").hide();       
      });       
    }
</script> 
<script type="text/javascript">
    function edit(id)
    {
        $("#loading").show();
      url=convertURL("EditProductAttribute.aspx?action=edit&attributeID="+$("#attributeDp :selected").attr("value")+"&pid="+$("#Hidden1").attr("value")+"&productattributeid="+id);
      ajax_get(url,'',function(msg)
      {
        $("#cpcontainer").empty().append(msg);   
        $("#loading").hide();       
      });     
    }
    
     function del(id)
    {
        if(confirm('确定要删除吗'))
        {
            $("#loading").show();
            url=convertURL("EditProductAttribute.aspx?action=del&attributeID="+$("#attributeDp :selected").attr("value")+"&pid="+$("#Hidden1").attr("value")+"&productattributeid="+id);
            ajax_get(url,'',function(msg)
           {
                $("#cpcontainer").empty().append(msg);   
                $("#loading").hide();       
           });    
         }   
    }
    function save()
    {
     var Param="";
      $("#loading").show();
      url=convertURL("EditProductAttribute.aspx?action=save&attributeID="+$("#attributeDp :selected").attr("value")+"&pid="+$("#Hidden1").attr("value")+"&productattributeid="+$("#Hidden2").attr("value")+"&attrValue="+escape($("#productAttributeVlaue_txt").attr("value")));
       Param+="&url="+$("#content").attr("value");
      ajax_post(url,Param,function(msg)
      {
            if(msg==1)
            {
                alert("请选择你要修改的属性！");
                $("#loading").hide();
            }
            else if(msg==2)
            {
                alert("属性名称不能为空！");
                $("#loading").hide();
            }
            else
            {
                $("#cpcontainer").empty().append(msg);   
                $("#loading").hide();
            }       
      });     
    }
    
    
</script>
</body>
</html>
